/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package kernel;

import gui.Factory;
import java.util.List;
import java.util.Vector;
import org.jdom.Element;

/**
 *
 * @author alvaro
 */
class ListModules {
    public static Vector<Module> getModules(){
        String s = System.getProperty("file.separator");
        XMLPluginConfiguration xml = new XMLPluginConfiguration(Factory.getWorkspace()+s+"files"+s+"modules.xml");

        List l = xml.selectNodes(xml.getDoc(), "/modules/module");

        Vector<Module> vec = new Vector<Module>();
        for(int i = 0;i<l.size();i++){
            vec.add(new Module(((Element) l.get(i)).getAttributeValue("name")));
        }

        return vec;
    }
}
